package controller;

import model.Order;
import model.Product;

import java.util.ArrayList;
import java.util.List;

public class OrderController {
    private List<Order> orderList = new ArrayList<>();

    public void createOrder(Order order) {
        orderList.add(order);
    }

    public Order getOrder(int id) {
        return orderList.stream().filter(o -> o.getId() == id).findFirst().orElse(null);
    }

    public List<Order> getAllOrders() {
        return orderList;
    }

    public List<Order> getOrdersByUser(String username) {
        // Placeholder: assuming orders have a user field
        return new ArrayList<>();
    }
}
